package routers

import (
	"github.com/gin-gonic/gin"
	"shop-admin/controller"
	"shop-security/preAuthorize"
)

func privateStoreProductRule(router *gin.RouterGroup) {
	api := &controller.StoreProductRuleController{}
	rule := router.Group("/prod/rule")
	{
		rule.GET("/page", preAuthorize.HasPermission("prod:rule:page"), api.Page)
		rule.GET("/info/:ruleId", preAuthorize.HasPermission("prod:rule:info"), api.Info)
		rule.POST("", preAuthorize.HasPermission("prod:rule:save"), api.Save)
		rule.PUT("", preAuthorize.HasPermission("prod:rule:update"), api.Update)
		rule.DELETE("", preAuthorize.HasPermission("prod:rule:delete"), api.Delete)
		rule.GET("/list", preAuthorize.HasPermission("prod:rule:list"), api.List)
	}
}
